package br.com.farm.util;

import java.math.BigDecimal;

public class MetodosEstaticosUtilitarios {
	public static String escapeCpfCnpj(String cpfCnpj){
		cpfCnpj = cpfCnpj.replaceAll("\\.", "").replaceAll("\\-", "").replaceAll("\\/", "");
		return cpfCnpj;
	}
	
	public static String escapeTelefone(String telefone){
		telefone = telefone.replaceAll(" ","" ).replaceAll("-", "").replaceAll("\\(", "").replaceAll("\\)", "");
		return telefone;
	}
	
	public static boolean isNumberInteger(String numberStr){
		try{
			int a = Integer.parseInt(numberStr);
		}catch(Exception ex){
			return false;
		}
		return true;
	}
	
	public static boolean isSomenteNumeros(String str){
		//Numero pode ser mt grande entao..
		try{
			BigDecimal numero = new BigDecimal(str);
			return true;
		}catch(Exception ex){
			return false;
		}
	}
	
	public static void main(String [] args){
		String saida = escapeTelefone("(61) 12312-2643");
		
		System.out.println(isSomenteNumeros(saida));
	}
}
